package com.kingyea.mobilepolice.apimanage.specification.bean;

import com.kingyea.mobilepolice.apimanage.specification.ResponseCode;

/**
 * @author cxc
 * @version v1.0.0
 * @description
 * @date Created in 2018-05-10 11:37
 */

public class SpecilficationBaseResponse {
    private Integer code;
    private String message;
    private Boolean success;
    private Object data;

    public SpecilficationBaseResponse() {
        this.code = ResponseCode.SUCCESS.getCode();
        this.message = ResponseCode.SUCCESS.getMsg();
        this.success = Boolean.TRUE;
    }

    public SpecilficationBaseResponse(ResponseCode errorResponseCode) {
        this.code = errorResponseCode.getCode();
        this.message = errorResponseCode.getMsg();
        this.success = Boolean.FALSE;
    }

    public SpecilficationBaseResponse(ResponseCode errorResponseCode, Boolean success) {
        this.code = errorResponseCode.getCode();
        this.message = errorResponseCode.getMsg();
        this.success = success;
    }

    public SpecilficationBaseResponse(Object data) {
        this();
        this.data = data;
    }

    public SpecilficationBaseResponse(Object data, ResponseCode responseCode) {
        this(responseCode);
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
